Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Enhancing Movie Playback Performance


SetMediaPlayHints

The SetMediaPlayHints function allows your application to provide information to the Movie Toolbox that can influence playback of a single media. This function accepts a flag in which you specify optimizations that the Movie Toolbox can use during movie playback. These optimizations apply to only the specified media.

pascal void SetMediaPlayHints (Media theMedia, long flags, 
                                 long flagsMask); 
theMedia
Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as NewTrackMedia and GetTrackMedia (described on page 2-138 and page 2-190, respectively).
flags
Specifies the optimizations that can be used with this media. Each bit in the flags parameter corresponds to a specific optimization. The following flag is defined (be sure to set unused flags to 0):
hintsScrubMode
Indicates that the Movie Toolbox can prefer to display key frames when the movie that uses this media is repositioned. This optimization is used only when a movie's rate is set to 0. If you set this flag to 1, the Movie Toolbox is free to display the nearest key frame when you set the movie's current time; the Movie Toolbox then moves to the appropriate frame as time permits. If you set this flag to 0, the Movie Toolbox displays the frame that corresponds to the new current time, even if that frame is not a key frame.
By displaying key frames first, the Movie Toolbox can display data from temporally compressed movies much more quickly in response to changes to the movie's current time. This, in turn, can improve the liveliness of a movie control. For example, if the user is positioning in a stopped movie, the Movie Toolbox can display a key frame that corresponds to the new position without having to build up the image offscreen. In this manner, the user gets quicker feedback from your application.
hintsUseSoundInterp
Turns on sound interpolation--that is, tells the Sound Manager to use sound interpolation when playing back sound. In certain situations, this improves the sound quality to 11 kHz.
hintsAllowInterlace
Tells the Image Compression Manager to use the interlace option for image compressor and decompressor components. For more information, see Inside Macintosh: QuickTime Components.
flagsMask
Indicates which flags in the flags parameter are to be considered in this operation. For each bit in the flags parameter that you want the Movie Toolbox to consider, you must set the corresponding bit in the flagsMask parameter to 1. Set unused flags to 0. This allows you to work with a single optimization without altering the settings of other flags.
ERROR CODES
invalidMedia-2008This media is corrupted or invalid
SEE ALSO
To set optimizations for all of a movie's media structures, use the SetMoviePlayHints function, which is described in the previous section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996